package com.ray.springbootspringdata.dao;

import com.ray.springbootspringdata.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;


/**
 * User: Ray.Shaw <p />
 * Time: 2019/10/30 18:08  <p />
 * Version: V1.0  <p />
 * Description:  <p />
 */


//泛型中第一个参数是实体类，第二个是id类型
public interface UserDao extends PagingAndSortingRepository<User, Integer>, JpaSpecificationExecutor<User>, JpaRepository<User, Integer> {
    @Query(value = "select * from User where username = ? ", nativeQuery = true)
    List<User> selectBy(String username);

}
